package com.example.spirngbootbase.controller;

import com.example.spirngbootbase.bean.SysUser;
import com.example.spirngbootbase.handle.ResponseResult;
import com.example.spirngbootbase.service.LoginService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName LoginController
 * @Description TODO
 * @Author mujiechen
 * @Date 2022/7/28
 */
@RestController
@RequestMapping("/sysUser")
public class LoginController {
    @Resource
    LoginService loginService;

    /**
     * 登录
     * @param sysUser
     * @return
     */
    @RequestMapping("/login")
    public ResponseResult login(SysUser sysUser){
        return loginService.login(sysUser);
    }

    /**
     * 退出登录
     * @return
     */
    @RequestMapping("/logOut")
    public ResponseResult logOut(){
        return loginService.logOut();
    }
}
